{% if site.gittalk.clientID and site.gittalk.clientSecret %}
<div id="gitalk-container"></div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<script >
  const gitalk = new Gitalk({
    clientID: '{{ site.gittalk.clientID }}',
    clientSecret: "{{ site.gittalk.clientSecret }}",
    repo: "{{ site.gittalk.repository }}",
    owner: "{{ site.gittalk.owner }}",
    admin: ["{{ site.gittalk.admin | split: ','  | join: '","'}}"],
    id: "{{ page.url }}",    // Ensure uniqueness and length less than 50 
    distractionFreeMode: false,  // Facebook-like distraction free mode
    perPage: 100
});

gitalk.render('gitalk-container')
</script>

{% endif %}
